package Array;

public class lc69 {
    public static void main(String[] args) {
        mySqrt(10);
    }

    public static int mySqrt(int x) {
        int left = 0;
        int right = Math.min(x,46340) + 1;
        while (left + 1 < right) {
            int m = (left + right) >>> 1;
            if (m * m <= x) {
                left = m;
            } else {
                right = m;
            }   
        }
        return left;
    }
}